<template>
  <div v-title :data-title="dataTitle?dataTitle:'基建现场管理单编辑'">
    <InfrastructureDetail ref="InfrastructureDetailBox" />
  </div>
</template>

<script>
import { getAction } from '@/api/manage'
import InfrastructureDetail from '@/views/workReport/infrastructure/InfrastructureDetail'
export default {
  components: {
    InfrastructureDetail,
  },
  data() {
    return {
      dataTitle:this.$route?this.$route.name:"",
      projectId: this.$route.params && this.$route.params.projectId,
    }
  },
  mounted() {
    if (this.projectId) {
      this.fetchProject()
    }
  },
  methods: {
    fetchProject() {
      getAction('/workReport/project/info' + '/' + this.projectId, {}).then((res) => {
        if (res.success) {
          this.$refs.InfrastructureDetailBox.initInfrastructure(res.result)
        }
      })
    },
  },
}
</script>